<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>购物车 | 超现实数码潮玩</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        /* 修复滚动条问题 */
        html {
            overflow-y: scroll;
        }

        body {
            width: 100vw;
            overflow-x: hidden;
            position: relative;
            background: #0a0a16;
            color: #fff;
            background-image:
                radial-gradient(circle at 10% 20%, rgba(255, 0, 128, 0.1) 0%, transparent 20%),
                radial-gradient(circle at 90% 80%, rgba(0, 255, 255, 0.1) 0%, transparent 20%),
                radial-gradient(circle at 50% 50%, rgba(128, 0, 255, 0.05) 0%, transparent 30%);
            min-height: 100vh;
        }

        /* 迷幻背景动画 */
        .psychedelic-bg {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: -1;
            opacity: 0.7;
            background:
                radial-gradient(circle at 20% 80%, rgba(255, 0, 128, 0.3) 0%, transparent 25%),
                radial-gradient(circle at 80% 20%, rgba(0, 255, 255, 0.3) 0%, transparent 25%),
                radial-gradient(circle at 40% 40%, rgba(128, 0, 255, 0.2) 0%, transparent 25%);
            animation: bgShift 15s infinite alternate;
        }

        @keyframes bgShift {
            0% {
                transform: scale(1) rotate(0deg);
            }

            100% {
                transform: scale(1.1) rotate(3deg);
            }
        }

        /* 导航栏 */
        nav {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 5%;
            /* position: fixed;
            top: 0;
            left: 0;
            z-index: 1000; */
            width: 100%;
            background: rgba(10, 10, 22, 0.9);
            backdrop-filter: blur(10px);
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .logo {
            font-size: 28px;
            font-weight: 800;
            background: linear-gradient(45deg, #ff00cc, #3333ff);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            text-shadow: 0 0 10px rgba(255, 0, 204, 0.5);
        }

        .nav-links {
            display: flex;
            gap: 30px;
        }

        .nav-links a {
            color: #fff;
            text-decoration: none;
            font-weight: 600;
            position: relative;
            padding: 5px 0;
            transition: all 0.3s;
        }

        .nav-links a.active {
            color: #ff00cc;
        }

        .nav-links a.active:after {
            width: 100%;
        }

        .nav-links a:after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 0;
            height: 2px;
            background: linear-gradient(90deg, #ff00cc, #3333ff);
            transition: width 0.3s;
        }

        .nav-links a:hover {
            color: #ff00cc;
        }

        .nav-links a:hover:after {
            width: 100%;
        }

        .cart-icon {
            position: relative;
            margin-left: 20px;
        }

        .cart-count {
            position: absolute;
            top: -8px;
            right: -8px;
            background: linear-gradient(45deg, #ff00cc, #3333ff);
            color: white;
            border-radius: 50%;
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.8rem;
            font-weight: bold;
        }

        /* 主标题区域 */
        .hero {
            text-align: center;
            padding: 100px 5% 80px;
            position: relative;
        }

        .hero h1 {
            font-size: 4rem;
            margin-bottom: 20px;
            background: linear-gradient(45deg, #ff00cc, #00ccff, #ffcc00);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            text-shadow: 0 0 20px rgba(255, 0, 204, 0.5);
            animation: titleGlow 3s infinite alternate;
        }

        @keyframes titleGlow {
            0% {
                text-shadow: 0 0 20px rgba(255, 0, 204, 0.5);
            }

            100% {
                text-shadow: 0 0 30px rgba(0, 204, 255, 0.7), 0 0 40px rgba(255, 204, 0, 0.5);
            }
        }

        .hero p {
            font-size: 1.3rem;
            max-width: 800px;
            margin: 0 auto 40px;
            color: #ccccff;
            line-height: 1.6;
        }

        /* 购物车内容区域 */
        .cart-content {
            padding: 50px 5%;
            position: relative;
            max-width: 1200px;
            margin: 0 auto;
        }

        .section-title {
            text-align: center;
            font-size: 2.5rem;
            margin-bottom: 50px;
            background: linear-gradient(45deg, #00ccff, #ffcc00);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            position: relative;
        }

        .section-title:after {
            content: '';
            position: absolute;
            bottom: -10px;
            left: 50%;
            transform: translateX(-50%);
            width: 100px;
            height: 3px;
            background: linear-gradient(90deg, #ff00cc, #3333ff);
        }

        .cart-container {
            display: flex;
            flex-wrap: wrap;
            gap: 40px;
        }

        .cart-items {
            flex: 3;
            min-width: 300px;
        }

        .cart-summary {
            flex: 1;
            min-width: 300px;
            background: rgba(20, 20, 40, 0.7);
            border-radius: 20px;
            padding: 30px;
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            height: fit-content;
            position: sticky;
            top: 20px;
        }

        .cart-item {
            display: flex;
            background: rgba(20, 20, 40, 0.7);
            border-radius: 20px;
            padding: 20px;
            margin-bottom: 20px;
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            transition: all 0.3s;
        }

        .cart-item:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 30px rgba(255, 0, 204, 0.3);
        }

        .item-image {
            width: 120px;
            height: 120px;
            background: linear-gradient(45deg, #ff00cc, #3333ff);
            border-radius: 15px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 20px;
            flex-shrink: 0;
        }

        .item-image i {
            font-size: 50px;
            color: white;
            opacity: 0.8;
        }

        .item-details {
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }

        .item-info h3 {
            font-size: 1.3rem;
            margin-bottom: 10px;
            color: #ffcc00;
        }

        .item-info p {
            color: #ccccff;
            font-size: 0.9rem;
            margin-bottom: 10px;
        }

        .item-price {
            font-size: 1.2rem;
            font-weight: 700;
            color: #00ccff;
        }

        .item-controls {
            display: flex;
            align-items: center;
            gap: 15px;
            margin-top: 10px;
        }

        .quantity-controls {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .quantity-btn {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.1);
            border: none;
            color: #ccccff;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s;
        }

        .quantity-btn:hover {
            background: linear-gradient(45deg, #ff00cc, #3333ff);
            color: white;
        }

        .quantity {
            min-width: 40px;
            text-align: center;
            font-weight: 600;
        }

        .remove-btn {
            background: rgba(255, 0, 0, 0.2);
            border: 1px solid rgba(255, 0, 0, 0.3);
            color: #ff6b6b;
            padding: 8px 15px;
            border-radius: 5px;
            cursor: pointer;
            transition: all 0.3s;
        }

        .remove-btn:hover {
            background: rgba(255, 0, 0, 0.3);
            color: white;
        }

        .summary-title {
            font-size: 1.5rem;
            margin-bottom: 20px;
            color: #ffcc00;
            text-align: center;
        }

        .summary-details {
            margin-bottom: 25px;
        }

        .summary-row {
            display: flex;
            justify-content: space-between;
            margin-bottom: 15px;
            padding-bottom: 10px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .summary-total {
            font-size: 1.3rem;
            font-weight: 700;
            color: #00ccff;
            border-bottom: none;
            margin-top: 10px;
        }

        .checkout-btn {
            width: 100%;
            padding: 15px;
            background: linear-gradient(45deg, #ff00cc, #3333ff);
            color: white;
            border: none;
            border-radius: 50px;
            font-size: 1.1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            box-shadow: 0 5px 15px rgba(255, 0, 204, 0.3);
        }

        .checkout-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(255, 0, 204, 0.5);
        }

        .continue-shopping {
            text-align: center;
            margin-top: 15px;
        }

        .continue-shopping a {
            color: #ccccff;
            text-decoration: none;
            transition: color 0.3s;
        }

        .continue-shopping a:hover {
            color: #ff00cc;
        }

        .empty-cart {
            text-align: center;
            padding: 60px 20px;
        }

        .empty-cart i {
            font-size: 80px;
            color: #ccccff;
            margin-bottom: 20px;
            opacity: 0.5;
        }

        .empty-cart h3 {
            font-size: 1.5rem;
            margin-bottom: 15px;
            color: #ffcc00;
        }

        .empty-cart p {
            color: #ccccff;
            margin-bottom: 30px;
        }

        .empty-cart .btn {
            display: inline-block;
            padding: 12px 30px;
            background: linear-gradient(45deg, #ff00cc, #3333ff);
            color: white;
            text-decoration: none;
            border-radius: 50px;
            font-weight: 600;
            transition: all 0.3s;
        }

        .empty-cart .btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 5px 15px rgba(255, 0, 204, 0.3);
        }

        /* 超现实元素 */
        .surreal-elements {
            position: absolute;
            pointer-events: none;
            z-index: 1;
        }

        .floating-shape {
            position: absolute;
            border-radius: 50%;
            opacity: 0.7;
            animation: float 6s infinite ease-in-out;
        }

        .shape-1 {
            width: 100px;
            height: 100px;
            background: radial-gradient(circle, #ff00cc, transparent);
            top: 10%;
            left: 5%;
            animation-delay: 0s;
        }

        .shape-2 {
            width: 150px;
            height: 150px;
            background: radial-gradient(circle, #00ccff, transparent);
            top: 60%;
            right: 10%;
            animation-delay: 2s;
        }

        .shape-3 {
            width: 80px;
            height: 80px;
            background: radial-gradient(circle, #ffcc00, transparent);
            bottom: 20%;
            left: 15%;
            animation-delay: 4s;
        }

        @keyframes float {
            0% {
                transform: translateY(0) rotate(0deg);
            }

            50% {
                transform: translateY(-20px) rotate(180deg);
            }

            100% {
                transform: translateY(0) rotate(360deg);
            }
        }

        /* 扭曲网格 */
        .distorted-grid {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-image:
                linear-gradient(rgba(255, 0, 204, 0.1) 1px, transparent 1px),
                linear-gradient(90deg, rgba(255, 0, 204, 0.1) 1px, transparent 1px);
            background-size: 50px 50px;
            animation: gridDistort 10s infinite linear;
            /* 以顶部为中心变换 */
            transform-origin: center top;
            z-index: -1;
        }

        @keyframes gridDistort {
            0% {
                transform: perspective(500px) rotateX(60deg) scale(1);
            }

            50% {
                transform: perspective(500px) rotateX(60deg) scale(1.2) skew(5deg, 5deg);
            }

            100% {
                transform: perspective(500px) rotateX(60deg) scale(1);
            }
        }

        /* 页脚 */
        footer {
            background: rgba(10, 10, 30, 0.9);
            padding: 50px 5% 30px;
            margin-top: 100px;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
        }

        .footer-content {
            display: flex;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 40px;
        }

        .footer-section {
            flex: 1;
            min-width: 250px;
        }

        .footer-section h3 {
            font-size: 1.3rem;
            margin-bottom: 20px;
            color: #ffcc00;
        }

        .footer-section p,
        .footer-section a {
            color: #ccccff;
            margin-bottom: 10px;
            display: block;
            text-decoration: none;
            transition: color 0.3s;
        }

        .footer-section a:hover {
            color: #ff00cc;
        }

        .social-links {
            display: flex;
            gap: 15px;
            margin-top: 15px;
        }

        .social-links a {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            background: linear-gradient(45deg, #ff00cc, #3333ff);
            border-radius: 50%;
            color: white;
            font-size: 1.2rem;
            transition: all 0.3s;
        }

        .social-links a:hover {
            transform: translateY(-5px);
        }

        .copyright {
            text-align: center;
            margin-top: 40px;
            padding-top: 20px;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            color: #8888cc;
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .hero h1 {
                font-size: 2.5rem;
            }

            .nav-links {
                display: none;
            }

            .cart-container {
                flex-direction: column;
            }

            .cart-item {
                flex-direction: column;
            }

            .item-image {
                width: 100%;
                height: 200px;
                margin-right: 0;
                margin-bottom: 15px;
            }

            .item-controls {
                justify-content: space-between;
            }
        }
    </style>
</head>

<body>
    <!-- 迷幻背景 -->
    <div class="psychedelic-bg"></div>

    <!-- 超现实浮动元素 -->
    <div class="surreal-elements">
        <div class="floating-shape shape-1"></div>
        <div class="floating-shape shape-2"></div>
        <div class="floating-shape shape-3"></div>
    </div>

    <!-- 扭曲网格 -->
    <div class="distorted-grid"></div>

    <!-- 导航栏 -->
    <nav>
        <div class="logo">PSYCHEDELIC TOYS</div>
        <div class="nav-links">
            <a href="index_2.html">首页</a>
            <a href="toys.html">潮玩</a>
            <a href="artists.html">艺术家</a>
            <a href="exhibitions.html">展览</a>
            <a href="news_list.html">新闻资讯</a>
            <a href="about.html">关于我们</a>
            <a href="cart.html" class="active">购物车</a>
        </div>
        <div class="cart-icon">
            <a href="cart.html"><i class="fas fa-shopping-cart"></i></a>
            <span class="cart-count" id="cartCount">3</span>
        </div>
    </nav>

    <!-- 主标题区域 -->
    <section class="hero">
        <h1>购物车</h1>
        <p>查看您选择的超现实数字潮玩，准备进入奇幻的收藏之旅</p>
    </section>

    <!-- 购物车内容区域 -->
    <section class="cart-content">
        <h2 class="section-title">我的收藏</h2>

        <div class="cart-container">
            <div class="cart-items" id="cartItems">
                <!-- 购物车商品将通过JavaScript动态生成 -->
            </div>

            <div class="cart-summary">
                <h3 class="summary-title">订单摘要</h3>
                <div class="summary-details">
                    <div class="summary-row">
                        <span>小计:</span>
                        <span id="subtotal">¥ 0</span>
                    </div>
                    <div class="summary-row">
                        <span>运费:</span>
                        <span id="shipping">¥ 0</span>
                    </div>
                    <div class="summary-row">
                        <span>折扣:</span>
                        <span id="discount">-¥ 0</span>
                    </div>
                    <div class="summary-row summary-total">
                        <span>总计:</span>
                        <span id="total">¥ 0</span>
                    </div>
                </div>
                <button class="checkout-btn">前往结算</button>
                <div class="continue-shopping">
                    <a href="toys.html">继续购物</a>
                </div>
            </div>
        </div>
    </section>

    <!-- 页脚 -->
    <footer>
        <div class="footer-content">
            <div class="footer-section">
                <h3>关于我们</h3>
                <p>我们是一家专注于超现实数字艺术品的创作与发行平台，致力于将前沿科技与艺术创新相结合。</p>
            </div>

            <div class="footer-section">
                <h3>快速链接</h3>
                <a href="index.html">首页</a>
                <a href="toys.html">潮玩</a>
                <a href="artists.html">艺术家</a>
                <a href="exhibitions.html">展览</a>
                <a href="about.html">关于我们</a>
            </div>

            <div class="footer-section">
                <h3>联系我们</h3>
                <p>邮箱: contact@psychedelictoys.com</p>
                <p>电话: +86 123 4567 8900</p>
                <div class="social-links">
                    <a href="#"><i class="fab fa-weibo"></i></a>
                    <a href="#"><i class="fab fa-weixin"></i></a>
                    <a href="#"><i class="fab fa-instagram"></i></a>
                    <a href="#"><i class="fab fa-discord"></i></a>
                </div>
            </div>
        </div>

        <div class="copyright">
            <p>&copy; 2023 超现实数码潮玩 | 保留所有权利</p>
        </div>
    </footer>

    <script>
        // 购物车数据
        let cartItems = [
            {
                id: 1,
                name: "量子机械兽",
                description: "融合量子力学与生物机械的超现实设计",
                price: 1299,
                quantity: 1,
                icon: "fas fa-robot"
            },
            {
                id: 2,
                name: "赛博龙族",
                description: "数字神话中的机械生物，限量版收藏品",
                price: 2499,
                quantity: 1,
                icon: "fas fa-dragon"
            },
            {
                id: 3,
                name: "幻影猫",
                description: "多重现实叠加的虚拟宠物",
                price: 899,
                quantity: 2,
                icon: "fas fa-cat"
            }
        ];

        // 渲染购物车商品
        function renderCartItems() {
            const cartItemsContainer = document.getElementById('cartItems');

            if (cartItems.length === 0) {
                cartItemsContainer.innerHTML = `
                    <div class="empty-cart">
                        <i class="fas fa-shopping-cart"></i>
                        <h3>购物车是空的</h3>
                        <p>快去挑选您喜欢的超现实数字潮玩吧！</p>
                        <a href="toys.html" class="btn">浏览潮玩</a>
                    </div>
                `;
                return;
            }

            cartItemsContainer.innerHTML = '';

            cartItems.forEach(item => {
                const itemElement = document.createElement('div');
                itemElement.className = 'cart-item';
                itemElement.innerHTML = `
                    <div class="item-image">
                        <i class="${item.icon}"></i>
                    </div>
                    <div class="item-details">
                        <div class="item-info">
                            <h3>${item.name}</h3>
                            <p>${item.description}</p>
                            <div class="item-price">¥ ${item.price}</div>
                        </div>
                        <div class="item-controls">
                            <div class="quantity-controls">
                                <button class="quantity-btn minus" data-id="${item.id}">-</button>
                                <span class="quantity">${item.quantity}</span>
                                <button class="quantity-btn plus" data-id="${item.id}">+</button>
                            </div>
                            <button class="remove-btn" data-id="${item.id}">删除</button>
                        </div>
                    </div>
                `;
                cartItemsContainer.appendChild(itemElement);
            });

            updateCartSummary();
            updateCartCount();
        }

        // 更新购物车摘要
        function updateCartSummary() {
            const subtotal = cartItems.reduce((sum, item) => sum + (item.price * item.quantity), 0);
            const shipping = subtotal > 0 ? 50 : 0; // 假设运费50元
            const discount = subtotal > 2000 ? 200 : 0; // 假设满2000减200

            document.getElementById('subtotal').textContent = `¥ ${subtotal}`;
            document.getElementById('shipping').textContent = `¥ ${shipping}`;
            document.getElementById('discount').textContent = `-¥ ${discount}`;
            document.getElementById('total').textContent = `¥ ${subtotal + shipping - discount}`;
        }

        // 更新购物车数量显示
        function updateCartCount() {
            const totalItems = cartItems.reduce((sum, item) => sum + item.quantity, 0);
            document.getElementById('cartCount').textContent = totalItems;
        }

        // 增加商品数量
        function increaseQuantity(itemId) {
            const item = cartItems.find(item => item.id === itemId);
            if (item) {
                item.quantity++;
                renderCartItems();
            }
        }

        // 减少商品数量
        function decreaseQuantity(itemId) {
            const item = cartItems.find(item => item.id === itemId);
            if (item && item.quantity > 1) {
                item.quantity--;
                renderCartItems();
            }
        }

        // 删除商品
        function removeItem(itemId) {
            cartItems = cartItems.filter(item => item.id !== itemId);
            renderCartItems();
        }

        // 初始化页面
        document.addEventListener('DOMContentLoaded', function () {
            renderCartItems();

            // 事件委托处理按钮点击
            document.getElementById('cartItems').addEventListener('click', function (e) {
                if (e.target.classList.contains('plus')) {
                    increaseQuantity(parseInt(e.target.getAttribute('data-id')));
                } else if (e.target.classList.contains('minus')) {
                    decreaseQuantity(parseInt(e.target.getAttribute('data-id')));
                } else if (e.target.classList.contains('remove-btn')) {
                    removeItem(parseInt(e.target.getAttribute('data-id')));
                }
            });

            // 结算按钮点击事件
            document.querySelector('.checkout-btn').addEventListener('click', function () {
                if (cartItems.length === 0) {
                    alert('购物车是空的，请先添加商品！');
                    return;
                }
                alert('结算功能即将开放，敬请期待！');
            });
        });

        // 鼠标跟随效果
        document.addEventListener('mousemove', function (e) {
            const shapes = document.querySelectorAll('.floating-shape');
            const x = e.clientX / window.innerWidth;
            const y = e.clientY / window.innerHeight;

            shapes.forEach((shape, index) => {
                const speed = (index + 1) * 0.5;
                const xMove = (x - 0.5) * speed * 50;
                const yMove = (y - 0.5) * speed * 50;

                shape.style.transform = `translate(${xMove}px, ${yMove}px)`;
            });
        });

        // 标题闪烁效果
        const title = document.querySelector('.hero h1');
        setInterval(() => {
            title.style.textShadow = `0 0 ${20 + Math.random() * 20}px rgba(${Math.random() * 255}, ${Math.random() * 255}, ${Math.random() * 255}, 0.7)`;
        }, 2000);
    </script>
</body>

</html>